#ifndef _KLAS_GL_TEXTURE_HPP_
#define _KLAS_GL_TEXTURE_HPP_

#include "../../Library.hpp"
#include "../../Platform.hpp"
#include "../../graphics/Texture.hpp"
#include "../../math/Matrix3.hpp"
#include "../../math/Vector2.hpp"

#include "../../GLLibs.hpp"

namespace klas
{
  namespace graphics
  {
    namespace gl
    {
      class GLTexture: public Texture, public library::Gl
      {
      public:
        GLTexture();
        GLTexture(string path);
        virtual ~GLTexture();

        virtual bool load(string path);
        virtual void kill();

        virtual bool isValid() const;

        //! Activate the texture to be rendered.
        void activate();

        //! Returns the padded dimensions of the texture.
        math::Vector2d getPaddedDim() const;

      private:
        //! The original dimensions of the image.
        math::Vector2d m_originalDim,

        //! The padded dimensions of the image.
                       m_paddedDim;

        //! ID of the texture.
        GLuint m_texID;

        //! Is the texture valid?
        bool m_isValid;

        //! Makes params zero
        void zero();

      };
    }
  }
}

#endif